package com.novax.ex.activity.open.api;


import com.novax.ex.activity.open.model.query.OrderQuery;
import com.novax.ex.activity.open.model.request.IeoOrderRequest;
import com.novax.ex.activity.open.model.request.IeoRecommendRequest;
import com.novax.ex.activity.open.model.response.IeoBuyRecommendResponse;
import com.novax.ex.activity.open.model.response.IeoSubscribeResponse;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * Description: IEO-申购
 *
 * @author shaw
 * @date 11/30/22 10:32
 */
@Tag(name = "IEO-前台展示-申购", description = "IEO-申购")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "IeoOrderApi", contextId = "IeoOrderApi")
@RequestMapping("/v3/orders")
public interface IeoOrderApi {

    @Operation(summary = "申购记录")
    @GetMapping
    ReturnResult<PageUtil<IeoSubscribeResponse>> page(@RequestHeader("userId") Long userId,
                                                      @ParameterObject OrderQuery query);

    @Operation(summary = "申购")
    @PostMapping
    ReturnResult<?> add(@RequestHeader("userId") Long userId,
                        @RequestHeader("language") String language,
                        @RequestHeader("uri") String uri,
                        @RequestBody IeoOrderRequest orderRequest);

    @Operation(summary = "申购推荐")
    @PostMapping(value = "/recommend")
    ReturnResult<IeoBuyRecommendResponse> recommend(@RequestHeader("userId") Long userId,
                                                    @RequestHeader("language") String language,
                                                    @RequestBody IeoRecommendRequest ieoRecommendRequest);

}
